package com.ihr360.alps.api;

import com.ihr360.alps.ApplicationDescriptor;
import com.ihr360.alps.ServiceDescriptor;
import feign.Headers;
import feign.Param;
import feign.RequestLine;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;


@RequestMapping(value = "/alps")
public interface AlpsProvider {
    /**
     * 获取应用可以提供的服务信息
     *
     * @return
     */
    @GetMapping(value = "/application", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestLine("GET /alps/application")
    ApplicationDescriptor applicationDescriptor();

    /**
     * 获取服务系统级别可以提供信息
     *
     * @return
     */
    @GetMapping(value = "/services/{service}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestLine("GET /alps/application/{service}")
    ServiceDescriptor serviceDescriptor(@PathVariable(name = "service") String serviceId);


    /**
     * 获取服务公司级别可以提供的信息
     *
     * @return
     */
    @Headers("Content-Type: application/json")
    @RequestLine(value = "POST /alps/companyService/{service}?companyId={companyId}")
    ServiceDescriptor companyServiceDescriptor(@Param(value = "service") String service,
                                               @Param(value = "companyId") String companyId);


}